/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86136
 * Date: 2024-05-18
 * Time: 20:50
 */
class WashMachine {
    //属性或成员变量
    public String brand;
    public String type;
    public double weight;
    //....

    //行为或成员方法
    public void washClothes() {
        System.out.println("洗衣服功能");
    }
    public void dryClothes() {
        System.out.println("脱水功能");
    }
    //....
}
class Dog{
    public String name;
    public int age;

    public void eat() {
        System.out.println(name + "吃狗粮");
    }
}
public class Test2 {
    public void test() {
        System.out.println("test....");
    }
    public static void main(String[] args) {
        Test2 test = new Test2();
        test.test();
        //引用.成员变量  引用.成员方法
        //test();
    }
    public static void main1(String[] args) {
        //由类生成对象的过程-->实例化
        Dog dog = new Dog();
        /*//没有对成员变量进行初始化，对其使用时是其默认的值，引用类型默认为null,基本数据类为其对应的0
        System.out.println(dog.name);
        System.out.println(dog.age);*/
        dog.age = 1;
        dog.name = "小黑";
        System.out.println(dog.name);
        System.out.println(dog.age);
        System.out.println("===========");

        Dog dog1 = new Dog();
        dog1.name = "小花";
        dog1.age = 2;
        System.out.println(dog1.name);
        System.out.println(dog1.age);

        /*int a;//局部变量-->必须初始化才能进行使用
        System.out.println(a);*/
    }
}
